import os
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
from launch_ros.actions import Node


def generate_launch_description():

    # 获取机器人的share目录路径
    bringup_dir = get_package_share_directory('wheels_uart')
    config_dir = os.path.join(bringup_dir, 'config')
    params_file = os.path.join(config_dir, 'params.yaml')

    return LaunchDescription([
        Node(
            package='wheels_uart',
            executable='wheels_uart_node',  # 使用 executable 来指定可执行文件
            name='wheels_uart_node',
            output='screen',
            parameters=[params_file],
        ),
    ])


